package com.nl.list;

import com.nl.list.LinkedList.Node;

public class ReverseList {

	public static <T> void reverse(LinkedList<T> list){
		
		if(list==null || list.phead == null || list.length <2){
			return ;
		}
		
		Node<T> pre=list.phead,node=list.phead.next;
		while(node!=null){
			Node<T> pnext= node.next;
			node.next =pre;
			pre=node;
			node=pnext;
		}
	}
}
